package cn.edu.zafu.bigdata.lyq.work6;

public class AgeCheck {
    public static void CheckAge(int age) throws InvalidAgeException{
        if (age<18){
            throw new InvalidAgeException("年龄必须大于等于18岁");
        }
        System.out.println("年龄为" + age +"岁。");
    }
}
